package com.sise.netty.reactor模型.单线程模型;

import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;

/**
 * @author idea
 * @data 2019/4/6
 */
public class ReactorClient {

    public static void main(String[] args) throws IOException, InterruptedException {
        SocketChannel socketChannel = SocketChannel.open();
        socketChannel.connect(new InetSocketAddress(InetAddress.getLocalHost(), 1222));
        socketChannel.configureBlocking(false);
        socketChannel.write(ByteBuffer.wrap("this is idea test".getBytes()));
        System.out.println("发送结束");
        Thread.sleep(5000);
    }
}
